package qsoft.omanga.business.component;

import android.content.Context;

import java.util.List;

import qsoft.omanga.base.dao.ChapterDAO;
import qsoft.omanga.business.entities.Chapter;

/**
 * 
 * @author sontt
 * 
 */
public class ChapterBusiness {

    /**
     * 
     */
    private ChapterDAO chapterDAO;

    /**
     * @param context
     *            Context
     */
    public ChapterBusiness(Context context) {
        chapterDAO = new ChapterDAO(context);
    }

    /**
     * @param chapter
     *            Chapter
     * @return long
     */
    public long save(Chapter chapter) {
        return chapterDAO.insert(chapter);
    }

    /**
     * @param mangaId
     *            String
     * @return ArrayList<Chapter>
     */
    public List<Chapter> getAll(String mangaId) {
        return chapterDAO.getChapters(mangaId);
    }
}
